import * as obj from "../NameSpace/NameScape"
obj.bar.name = "zhangs";

declare module foo{
    export let cc:string;
}

namespace Utill{
    export function log(str:string){
        console.log(str);
    }
    export function resever<T>(itrm:T[]):T[] {
        itrm.reverse();
        return itrm;
    }
    export function extend<T,U>(frist:T,second:U):T & U{
        let ruselt= {} as T & U;
        for(let id in frist){
            (<T>ruselt)[id] = frist[id];
        }
        for(let id in second){
            if(!ruselt.hasOwnProperty(id)) {
                (<U>ruselt)[id] = second[id];
            }
        }
        return ruselt;
    }
}
Utill.log("hello world");
let arr = [1,"lisi",true];
arr = Utill.resever(arr);
console.log(arr);
type strNum = string|number;
let strnum : strNum=123;

interface Foo {
    [index:string]:number;
    x:string;
    y:number;
}
// Error
interface Bar {
    [key: string]: number;
    x: number;
    y: string; // Error: y 属性必须为 number 类型
}